package ink.tiptop.persist.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import ink.tiptop.persist.domain.entity.ZjfUserModuleVersionEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用于用户-模块版本的映射 
User:module = 1:n
(ZjfUserModuleVersionEntity)表数据库访问层
 *
 * @author makejava
 * @since 2020-06-21 20:39:19
 */

@Mapper
public interface ZjfUserModuleVersionMapper extends BaseMapper<ZjfUserModuleVersionEntity> {

    @Select("SELECT DISTINCT\n" +
            "( b.id )\n" +
            "FROM \n" +
            "zjf_module_local_view a\n" +
            "INNER JOIN zjf_user_module_version b ON a.version = b.version\n" +
            "where b.id in ( ${ids} )")
    List<Integer> listRelatedIdList(@Param("ids") String ids);
}